package week07.midTest;

import java.util.Random;

public class PlaneProxy implements  Plane{
    public Plane plane=new PlaneAdapter();

    public PlaneProxy(Plane plane) {
        this.plane = plane;
    }

    @Override
    public void takeOff() {
        Random random=new Random();
        if (random.nextBoolean()){
            this.plane.takeOff();
            System.out.println("已通知XX飞机起飞");

        }else {
            System.out.println("飞机出现事故起飞失败");
        }

    }
}
